package com.hy.medicine.evaluation.service.impl;

import com.hy.medicine.evaluation.dto.MedicineEvaluationDTO;
import com.hy.medicine.evaluation.service.MedicineEvaluationService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;

@Service
public class MedicineEvaluationServiceImpl implements MedicineEvaluationService {

    @Override
    public void addEvaluation(MedicineEvaluationDTO dto) {
        // 验证必要字段
        if (dto.getMedicineId() == null) {
            throw new ServiceException("药品ID不能为空");
        }
        if (dto.getEvaluationScore() == null) {
            throw new ServiceException("评分不能为空");
        }
        if (StringUtils.isBlank(dto.getEvaluationContent())) {
            throw new ServiceException("评价内容不能为空");
        }
        
        // 订单ID是可选的，不需要验证
        
        // 保存评价信息
        // ...
    }
} 